<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			<my-cpn></my-cpn>
			<you-cpn></you-cpn>
		</div>
		
	</body>
	
	<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
	<!-- 分离写法1 -->
	<!-- 将组件模板写到script中 -->
	<script type="text/x-template" id="cpn">
		<div>
			<h3>helloworld</h3>
			<p>你好世界!</p>
		</div>
	</script>
	<!-- 分离写法2 -->
	<!-- 将组件模板写到template中 -->
	<template id="cpn2">
		<div>
			<h3>show me code</h3>
			<p>你好世界!</p>
		</div>
	</template>
	<script type="text/javascript">
		Vue.component('my-cpn',{
			// 像el一样写法写上id名
			template:'#cpn'
		})
		Vue.component('you-cpn',{
			template:'#cpn2'
		})
		const app = new Vue({
			el : "#app",
			data : {
				
			}
		})
	</script>
</html>
